package com.umeox.watch.moto.apiclient.model;

import android.os.Parcel;
import android.os.Parcelable;

public class SubmitTaskRecordDTO implements Parcelable {

    //记录ID
    public int id;

    //任务完成时间 格式：yyyy-MM-dd HH:mm:ss
    public String completeTime;

    //任务开始时间 格式：yyyyMMddTHHmmssZ 例：20200520T000000+0800
    public String startTime;

    //额外信息
    public TaskRecordAdditionalInfoDTO additionalInfo;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeString(this.completeTime);
        dest.writeString(this.startTime);
        dest.writeParcelable(additionalInfo, flags);
    }

    public SubmitTaskRecordDTO() {

    }

    protected SubmitTaskRecordDTO(Parcel in) {
        this.id = in.readInt();
        this.completeTime = in.readString();
        this.startTime = in.readString();
        this.additionalInfo = in.readParcelable(TaskRecordAdditionalInfoDTO.class.getClassLoader());
    }

    public static final Parcelable.Creator<SubmitTaskRecordDTO> CREATOR = new Parcelable.Creator<SubmitTaskRecordDTO>() {
        public SubmitTaskRecordDTO createFromParcel(Parcel source) {
            return new SubmitTaskRecordDTO(source);
        }

        public SubmitTaskRecordDTO[] newArray(int size) {
            return new SubmitTaskRecordDTO[size];
        }
    };

    @Override
    public String toString() {
        return "SubmitTaskRecordDTO{" +
                "id=" + id +
                ", completeTime='" + completeTime + '\'' +
                ", startTime='" + startTime + '\'' +
                ", additionalInfo=" + additionalInfo +
                '}';
    }
}